package com.yunwaikeji.gy_tool_library.utils.http.upload;

import com.yunwaikeji.gy_tool_library.utils.http.GYHttpModel;

import java.io.File;

public class GYUploadModel<Model extends GYUploadModel<Model>> extends GYHttpModel<Model> {
    private String urlName = "file";//请求名称
    private File file;//文件
    private String fileName;//文件名称
    private int cacheSize = 1024;//缓存速度

    public GYUploadModel() {
        setRequestMethod(RequestMethod.POST);
    }

    public String getUrlName() {
        return urlName;
    }

    public Model setUrlName(String urlName) {
        this.urlName = urlName;
        return getModel();
    }

    public File getFile() {
        return file;
    }

    public Model setFile(File file) {
        this.file = file;
        return getModel();
    }

    public Model setFile(String file) {
        return setFile(new File(file));
    }

    public String getFileName() {
        return fileName;
    }

    public Model setFileName(String fileName) {
        this.fileName = fileName;
        return getModel();
    }

    public int getCacheSize() {
        return cacheSize;
    }

    public Model setCacheSize(int cacheSize) {
        this.cacheSize = cacheSize;
        return getModel();
    }
}
